package inttest;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: leep
 * Date: 15-10-13
 * Time: 下午4:44
 * To change this template use File | Settings | File Templates.
 */
public class IntTest {
	public static void main(String[] args) {

		int a = 10000;
		System.out.println(Float.valueOf(a / 100.00f).toString());


		System.out.println(sqrt("a man, a plan, a 11anal: panama"));


		System.out.println(anagram("ab", "ab"));
	}

	public static boolean anagram(String s, String t) {
		if (s.length() != t.length()) {
			return false;
		}
		int length = s.length();
		boolean result = false;
		for (int i = 0; i < length; i++) {
			if (s.charAt(length - 1 - i) != t.charAt(i)) {
				break;
			} else {
				result = true;
			}
		}
		return result;
	}

	public static boolean sqrt(String x) {

		String obj = x.toLowerCase();
		String newStr = "";
		for (int i = 0; i < obj.length(); i++) {
			if ((obj.charAt(i) <= 'z' && obj.charAt(i) >= 'a') || (obj.charAt(i) <= '9' && obj.charAt(i) >= '0')) {
				newStr += obj.charAt(i);
			}
		}
		String a = String.valueOf(newStr);
		boolean result = true;
		int length = a.length() - 1;
		for (int i = 0; i < length; i++) {
			if (a.charAt(i) != a.charAt(length - i)) {
				result = false;
			}
		}
		return result;
	}
}
